<%-- 
    Document   : update2
    Created on : 2014/8/19, 下午 02:19:17
    Author     : Yu
--%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    String username = request.getParameter("username");
    String tel = request.getParameter("tel");
    String birthday = request.getParameter("birthday");
    String id = request.getParameter("id");
    
    Class.forName("com.mysql.jdbc.Driver");
    Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/javadb", "root", "007341");
    Statement st = con.createStatement();
    String sql = "update person set username='"+username+"', tel='"+tel+"',birthday=' "+birthday+" ' where id="+id;
    System.out.println(sql);
    int x = st.executeUpdate(sql);
    st.close();
    con.close();


%>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	
	
        <title>update2</title>
    </head>
    <body>
        <h1>~~update2~~</h1>
	<%=  x   %>	
	<a href="list.jsp">list</a>
    </body>
</html>
